Realmente muito bom SmiX. Tenho apenas duas dúvidas, ele funciona no PDA (Sem Level) do Slicer? Teria como fazer por talkaction em vez de action?
- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- Duel System Por Action
info
Grupo: Campones
Registrado: 11/08/12
Posts: 23
Reputação: 0

Sim, funciona no PDA. Acho que é melhor por action fiz mais "REAL".
info
Grupo: Campones
Registrado: 11/08/12
Posts: 23
Reputação: 0

@SmiX,
Obrigado por me responder e sobre a questão de fazer por talkaction era apenas uma duvida. Irei utilizar seu sistema com certeza.
info
Grupo: Visconde
Registrado: 03/01/11
Posts: 303
Reputação: +47

Tô gostando de ver Smix ![]()
Tá melhorando teus scripts kkk
Perto daquele dos Ícones tá bem melhor ![]()
Muito bom mesmo ![]()
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

Obrigado por disponibilizar um system bãoo desse, vai ajuda bastante gente !thanks.
Vou aceitar isso como um elogio.
info
Grupo: Barão
Registrado: 01/05/11
Posts: 234
Reputação: +43
Gênero: Masculino

@SmiX, teria como adaptar isso no order por exemplo??
tem como me explicar como faço?
info
Grupo: Visconde
Registrado: 03/01/11
Posts: 303
Reputação: +47

@smix Foi sim um elogio ![]()
O que quis dizer é que apenas poderia ter feito o outro sistema lá com bem menos coisas, entende?
Mas mesmo assim é uma ótima iniciativa, é dificil ver alguem que posta os sistemas que faz.
Rep pra vc ![]()
info
Grupo: Campones
Registrado: 24/11/10
Posts: 13
Reputação: 0

@Smix
aqui deu os seguintes erros.
[Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/duelSystem.lua: No such file or directory
[12/08/2012 20:59:18] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/duelSystem.lua)
[12/08/2012 20:59:18] cannot open data/actions/scripts/duelSystem.lua: No such file or directory
[12/08/2012 20:59:19] [Error - LuaScriptInterface::loadFile] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/duel.lua)
[12/08/2012 20:59:19] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Error - LuaScriptInterface::loadFile] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/duel.lua)
[12/08/2012 20:59:19] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:20] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/duelSystemChannel.lua: No such file or directory
[12/08/2012 20:59:20] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/duelSystemChannel.lua)
[12/08/2012 20:59:20] cannot open data/creaturescripts/scripts/duelSystemChannel.lua: No such file or directory
[12/08/2012 20:59:20] >> Loading chat channels
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51.
Help plx
@Sky2,
@Smix
aqui deu os seguintes erros.
[Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/duelSystem.lua: No such file or directory
[12/08/2012 20:59:18] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/duelSystem.lua)
[12/08/2012 20:59:18] cannot open data/actions/scripts/duelSystem.lua: No such file or directory
[12/08/2012 20:59:19] [Error - LuaScriptInterface::loadFile] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/duel.lua)
[12/08/2012 20:59:19] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Error - LuaScriptInterface::loadFile] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:19] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/duel.lua)
[12/08/2012 20:59:19] cannot open data/talkactions/scripts/duel.lua: No such file or directory
[12/08/2012 20:59:20] [Error - LuaScriptInterface::loadFile] cannot open data/creaturescripts/scripts/duelSystemChannel.lua: No such file or directory
[12/08/2012 20:59:20] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/duelSystemChannel.lua)
[12/08/2012 20:59:20] cannot open data/creaturescripts/scripts/duelSystemChannel.lua: No such file or directory
[12/08/2012 20:59:20] >> Loading chat channels
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51
[12/08/2012 20:59:20] [Warning - Vocations::getVocation] Vocation 51 not found.
[12/08/2012 20:59:20] [Warning - Chat::loadFromXml] Wrong vocation id: 51.
Help plx
pra arruma 1º erro, vai no talkactions.xml e altera:
<talkaction words="yes" case-sensitive="no" hide="yes" event="script" value="duel.lua"/>
<talkaction words="sim" case-sensitive="no" hide="yes" event="script" value="duel.lua"/>
para:
<talkaction words="yes" case-sensitive="no" hide="yes" event="script" value="acceptduel.lua"/>
<talkaction words="sim" case-sensitive="no" hide="yes" event="script" value="acceptduel.lua"/>
pra arruma o 2º erro, vc pulo uma parte, intaum vai no vocations.xml (dentro da pasta "data/xml") e acrecenta..
<vocation id="51" name="Duel" description="pokemon trainer" needpremium="0" gaincap="0" gainhp="55" gainmana="0" gainhpticks="0" gainhpamount="0" gainmanaticks="0" gainmanaamount="0" manamultiplier="1.1" attackspeed="-1" soulmax="251" gainsoulticks="-1" fromvoc="1" lessloss="0">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="2" club="2" sword="2" axe="2" distance="2" shielding="2" fishing="2" experience="1.1"/>
</vocation>
@all, consegui coloca no order, mais qual o comando pra cancelar o DUEL?!?!
sempre que eu relogo, da duel accept ^^
Editado Agosto 13 por GOD Gniu
Boa SmiX eu tinha um systema parecido com o seu mais falto terminar, parabens... fico muito bom mesmo.
info
Grupo: Campones
Registrado: 21/07/12
Posts: 49
Reputação: +8

@smix,
O seu sistema não pegou aqui no meu servidor, uso o PDA by Slicer v1.5 e não pega de geito nenhum, modifiquei tudo aqui, não apresenta erros nem nada, eu estava testando com a sword, mudei a sprite dela e quando dei use with em um char diferente não apareceu nada... Tem como resolver?








info
Grupo: Conde
Registrado: 25/01/12
Posts: 963
Reputação: +265
Olá galera, hoje vou postar mais um script para pokemon dash advanced. Bem legal e acho que também é um dos mais procurados... Vamos a ele.
Nome: Duel System por Action
O que faz? Faz com que dois players duelem com limites de pokemons, escolhido no inicio das configurações da batalha.
Primeiro vamos à actions/scripts e criaremos um arquivo chamado duelSystem.lua e dentro vamos colar o código abaixo:
Agora vamos a tag, em actions.XML cole a seguinte tag:
Pronto. Vamos a pasta xml/channels.xml e crie as seguintes janelas:
Depois disso, não mude mais nada. Vamos agora em vocations.xml e vamos colar a seguinte tag dentro:
Feito isso, vamos a pasta creaturescripts/scripts e vamos criar um arquivo chamado duelSystemChannel.lua e colaremos o código a seguir dentro:
local config = { channelId1 = 13, -- Aqui você coloca-ra o id da sua primeira channel. A qual está escrito "1 Pokemon". channelId2 = 14, -- Aqui você coloca-rá o id da sua 2° channel. A qual está escrito "2 Pokemons". channelId3 = 15, -- Aqui você coloca-rá o id da sua 3° channel. A qual está escrito "3 Pokemons". channelId4 = 16, -- Aqui você coloca-rá o id da sua 4° channel. A qual está escrito "4 Pokemons". channelId5 = 17, -- Aqui você coloca-rá o id da sua 5° channel. A qual está escrito "5 Pokemons". channelId6 = 18, -- Aqui você coloca-rá o id da sua 6° channel. A qual está escrito "6 Pokemons". } function onJoinChannel(cid, channelId, users, isTv) if getPlayerVocation(cid) == 51 then else return true end if channelId == config.channelId1 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 1) doSendAnimatedText(getThingPos(cid), "1 Poke", 28) doPlayerSetVocation(cid, 1) return false elseif channelId == config.channelId2 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 2) doSendAnimatedText(getThingPos(cid), "2 Pokes", 28) doPlayerSetVocation(cid, 1) return false elseif channelId == config.channelId3 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 3) doSendAnimatedText(getThingPos(cid), "3 Pokes", 28) doPlayerSetVocation(cid, 1) return false elseif channelId == config.channelId4 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 4) doSendAnimatedText(getThingPos(cid), "4 Pokes", 28) doPlayerSetVocation(cid, 1) return false elseif channelId == config.channelId5 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 5) doSendAnimatedText(getThingPos(cid), "5 Pokes", 28) doPlayerSetVocation(cid, 1) return false elseif channelId == config.channelId6 then setPlayerStorageValue(cid, 12541, 0) setPlayerStorageValue(cid, 12542, 1) setGlobalStorageValue(12542, 6) doSendAnimatedText(getThingPos(cid), "6 Pokes", 28) doPlayerSetVocation(cid, 1) return false end return true endAgora vamos colocar duas tags, uma em login.lua e a outra em creaturescripts.xml:
CreatureScript.xml:
Login.lua
Feito isso, vamos a talkactions/scripts e criaremos um arquivo chamado acceptDuel.lua e dentro cole o código abaixo:
Agora vamos á talkactions.XML e colaremos as tag a seguir:
Agora vamos em lib/ e criaremos um arquivo chamado duelLibSystem.lua e colaremos o seguinte código dentro:
Vamos para actions/scripts/goback.lua e vamos procurar por está linha:
Abaixo disso cole isso:
Aindan no mesmo script procure por:
E abaixo dele cole isso:
Vamos agora em creaturescripts/scripts/goback.lua e antes do utimo apague tudo e cole isto dentro:
function onLogout(cid) if getPlayerStorageValue(cid, 1460) >= 1 then doPlayerSendCancel(cid, "Sorry, you are in tournament.") return TRUE end local thisitem = getPlayerSlotItem(cid, 8) local pokeballl = getPlayerSlotItem(cid, 8) if thisitem.uid <= 0 then return true end local ballName = getItemAttribute(thisitem.uid, "poke") -------------------------------------------------------- btype = getPokeballType(thisitem.itemid) --------------------------------------------------------------- if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 637501) >= 1 then BackTeam(cid, getCreatureSummons(cid), effect) --edited team scyther end ------------------------------------------------------------------- local summon = getCreatureSummons(cid)[1] if #getCreatureSummons(cid) == 1 and thisitem.uid > 1 then doItemSetAttribute(thisitem.uid, "hp", getPlayerStorageValue(cid, 212120) / getPlayerStorageValue(cid, 212121)) doTransformItem(thisitem.uid, pokeballs[btype].on) doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect) doRemoveCreature(summon) end if getCreatureOutfit(cid).lookType == 814 then doPlayerStopWatching(cid) end if getPlayerStorageValue(cid, 17000) >= 1 then markFlyingPos(cid, getThingPos(cid)) end if getPlayerStorageValue(cid, 22545) == 1 then --Edited golden arena setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1) setPlayerStorageValue(cid, 22545, -1) end return TRUE end local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!", "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"} function onDeath(cid, deathList) local owner = getCreatureMaster(cid) local thisball = getPlayerSlotItem(owner, 8) local ballName = getItemAttribute(thisball.uid, "poke") if getPlayerStorageValue(cid, 212124) >= 1 then return true end btype = getPokeballType(thisball.itemid) doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect) doTransformItem(thisball.uid, pokeballs[btype].off) doItemSetAttribute(thisball.uid, "morta", "yes") doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.") local say = deathtexts[math.random(#deathtexts)] say = string.gsub(say, "POKENAME", getCreatureName(cid)) if getPlayerStorageValue(cid, 33) <= 0 then doCreatureSay(owner, say, TALKTYPE_SAY) end doItemSetAttribute(thisball.uid, "hp", 0) doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath) doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009)) doRemoveCreature(cid) if getGlobalStorageValue(1203) >= 1 and getPlayerStorageValue(owner, 12541) <= getGlobalStorageValue(12542) then doSendAnimatedText(getThingPos(owner), "POKEOUT", 118) end return false endObs: O script falta duas funções para funcionar perfeitamente. A primeira é para não deixar o player usar o item em cima dele mesmo. A segunda e para não deixar o player deslogar enquanto está no duel. Tentei e tentei mas não consegui... Caso alguém possa ajudar fico muito grato.
Como funciona?
Você da use em cima do player que quer batalhar, escolhe quantos pokemons querem usar. O outro player fala (“yes” ou “sim”) e começam a duelar. Eu deixei uma função para deixar um player attackar o outro se ele estiver sem pokemon. Porem não perdera nada se morrer.
É isso galera espero que gostem. Lembrando vou atualizar este sistema para melhora-lo. Só deixei ele para teste. Caso gostem termino ele.